<template>
  <div>
    <div class="logistics-info-header">
      <div class="logistics-info-header-left">
        <div class="logistics-status " >
          {{ sta(orderInfo.logisticsStatus) }}
        </div>
        <div class="logistics-company">{{ orderInfo.logisticsCompany }}</div>
        <div class="logistics-no">{{ orderInfo.logisticsNo }}</div>
      </div>
    </div>

    <ul class="logistics-info-list">
      <li v-for="(item, index) in orderInfo.logisticsInfo" :key="index">
        <div class="logistics-info-list-time">{{ item.time }}</div>
        <div class="logistics-info-list-content">{{ item.content }}</div>
      </li>
    </ul>
    <button @click="xq">查看物流详情</button>
  </div>
</template>

<script>
// import { computed } from 'vue'
export default {
  data () {
    return {
      status: ''
    }
  },
  props: {
    orderInfo: {
      type: Object
    },
    list: {
      type: Array
    }
  },
  computed: {
    sta () {
      return function (status) {
        switch (status) {
          case 0:
            return '未发货'
          case 1:
            return '已发货'
          case 2:
            return '已签收'
          case 3:
            return '未签收'
        }
      }
    }
  },
  methods: {
    xq () {
      if (this.orderInfo.role === 'admin') {
        alert('验证成功')
      } else if (this.orderInfo.role === 'zhangsan') {
        alert('验证成功')
      } else if (this.orderInfo.role === 'lisi') {
        alert('验证成功')
      } else {
        alert('验证失败')
      }
    }
  }
}
</script>

<style>
.red{
  color: red;
}
.black{
  color: black;
}
.green{
  color: green;
}
.yellow{
  color: yellow;
}
</style>
